﻿using Basic.FormRemoteModel;

namespace Basic.FormModel
{
    public class ConstDic
    {
        public class TableColTemplate
        {
            public string Description
            {
                get;
                set;
            }

            public string Name
            {
                get;
                set;
            }

            public PhyTableDataType DataType
            {
                get;
                set;
            }
            public short Len { get; set; }
            public int Sort { get; set; }
        }
        public static readonly string KeyColName = "Id";

        public static readonly string ForeignKeyColName = "MainId";

        public static readonly string CompanyIdColName = "CompanyId";

        public static readonly string LinkPk = "LinkPk";

        public static readonly string LinkType = "LinkType";

        public static readonly string CreateTimeColName = "AddTime";

        public static readonly string PagePowerLinkType = "FormPageApp";

        public static readonly string FormPagePath = "customForm/views/customPage/pageDetailed";
        public static readonly string FormPageRoutePath = "form/page/detailed/:id";

        public static readonly string FormPageRouteName = "appPage";

        public static readonly TableColTemplate[] SubCol = new TableColTemplate[]
       {
            new TableColTemplate
            {
              Name = ConstDic.KeyColName,
               Description="主键ID",
               DataType = PhyTableDataType.Long,
            },
            new TableColTemplate
            {
                Description = "主表ID",
                Name = "MainId",
                DataType = PhyTableDataType.Long,
            }
        };
        public static readonly TableColTemplate[] MainCol = new TableColTemplate[]
        {
           new TableColTemplate
            {
               Name = ConstDic.KeyColName,
               Description="主键ID",
               DataType = PhyTableDataType.Long,
            },
            new TableColTemplate
            {
                Description = "所属公司ID",
                Name = ConstDic.CompanyIdColName,
                DataType = PhyTableDataType.Long
            },
            new TableColTemplate
            {
                Description = "关联业务类型",
                Name = ConstDic.LinkType,
                DataType =  PhyTableDataType.Varchar,
                Len=50
            },
            new TableColTemplate
            {
                Description = "关联业务ID",
                Name = ConstDic.LinkPk,
                 DataType = PhyTableDataType.Long
            },
            new TableColTemplate
            {
                Description = "添加时间",
                Name = ConstDic.CreateTimeColName,
                DataType= PhyTableDataType.DateTime,
                Sort=99
            },
        };
    }
}
